import Vue from 'vue';
import VueRouter from 'vue-router';

const Home = () =>import('views/home/Home');
const Classify = () => import('views/classify/Classify');
const Shop = () => import('views/shop/Shop');
const Me = () => import('views/me/Me');
const Detail = () => import('views/detail/Detail');

//1.安装
Vue.use(VueRouter);

//2.创建路由对象
const routes = [
  {
    path:'',
    redirect:'/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/classify',
    component: Classify
  },
  {
    path: '/shop',
    component: Shop
  },
  {
    path: '/me',
    component: Me
  },
  {
    path: '/detail/:iid',
    component: Detail
  }
]
const router = new VueRouter({
  routes,
  mode: 'history'
})
//3.导出
export default router